package seminarski.geometrija;

import java.util.ArrayList;

import seminarski.utils.Utils;

import common.point.PointG;

public class PointSetGenerator {

	public static ArrayList<PointG<Double>> izduzeno(double widthMin, double widthMax, double heightMin, double heightMax, int numPoints){
		ArrayList<PointG<Double>> points = new ArrayList<PointG<Double>>();
		for(int i = 0; i < numPoints; i++){
			PointG<Double> p = new PointG<Double>(Utils.nextDouble(widthMin, widthMax), Utils.nextDouble(heightMin, heightMax));
			points.add(p);
		}
		return points;
	}
	
	
	public static ArrayList<PointG<Double>> poDvaKruga(PointG<Double> c1, double r1, PointG<Double> c2, 
			double r2, int numPoints){
		ArrayList<PointG<Double>> points = new ArrayList<PointG<Double>>();
		
		for(int i = 0; i < numPoints/2; i++){
			double alpha = Utils.nextDouble(0, 2*Math.PI);
			double cosalpha = Math.cos(alpha);
			double sinalpha = Math.sin(alpha);
			double rand = Utils.nextDouble(0, r1); 
			PointG<Double> p = new PointG<Double>(c1.x() + rand*cosalpha, c1.y() + rand*sinalpha);
			points.add(p);
			rand = Utils.nextDouble(0, r2);
			p = new PointG<Double>(c2.x() + rand*cosalpha, c2.y() + rand*sinalpha);
			points.add(p);
		}
		return points;
	}
	
	public static ArrayList<PointG<Double>> uniformno(double xMin, double xMax, double yMin, double yMax, int pointCount){
		ArrayList<PointG<Double>> points = new ArrayList<PointG<Double>>();

		for (int i = 0; i < pointCount; i++)
			points.add(new PointG<Double>(Utils.nextDouble(100.0, 450.0),
					Utils.nextDouble(100.0, 450.0)));
		return points;
	}
	
	public static void main(String[] args) {
		System.out.println();
	}
	
}
